<!DOCTYPE html>
<html lang="{{ config('app.locale') }}">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title> 888</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

    {!! Admin::css() !!}

    <script src="{{ Admin::jQuery() }}"></script>
    {!! Admin::headerJs() !!}
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body class="hold-transition {{config('admin.skin')}} {{join(' ', config('admin.layout'))}}">
<div class="wrapper">

    @include('admin::partials.header')

    @include('admin::partials.sidebar')

    <div class="content-wrapper" id="pjax-container">
        <div id="app">
            <section class="content-header">
                <h1>
                    Create
                    <small>description</small>
                </h1>
                <!-- breadcrumb start -->
                <ol class="breadcrumb" style="margin-right: 30px;">
                    <li><a href="http://www.laras.com/admin"><i class="fa fa-dashboard"></i> Home</a></li>
                    <li>
                        Goods
                    </li>
                    <li>
                        GoodsList
                    </li>
                    <li>
                        Create
                    </li>
                </ol>
                <!-- breadcrumb end -->
            </section>

            <section class="content">
                <div class="row">
                    <div class="col-md-12">
                        <div class="box box-info">
                            <div class="box-header with-border">
                                <h3 class="box-title">创建</h3>

                                <div class="box-tools">
                                    <div class="btn-group pull-right" style="margin-right: 5px">
                                        <a href="http://www.laras.com/admin/goods/goodsList" class="btn btn-sm btn-default" title="列表"><i class="fa fa-list"></i><span class="hidden-xs">&nbsp;列表</span></a>
                                    </div>
                                </div>
                            </div>
                            <!-- /.box-header -->
                            <!-- form start -->
                            <form action="http://www.laras.com/admin/goods/goodsList" method="post" accept-charset="UTF-8" class="form-horizontal" enctype="multipart/form-data" pjax-container>
                                <div class="box-body">
                                    <div class="fields-group">

                                        <div class="form-group  ">
                                            <label for="goods_name" class="col-sm-2  control-label">商品名称</label>
                                            <div class="col-sm-8">
                                                <div class="input-group">
                                                    <span class="input-group-addon"><i class="fa fa-pencil fa-fw"></i></span>
                                                    <input type="text" id="goods_name" name="goods_name" value="" class="form-control goods_name" placeholder="输入 商品名称" />
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group  ">
                                            <label for="is_new" class="col-sm-2  control-label">是否新上</label>
                                            <div class="col-sm-8">
                                                <input type="hidden" name="is_new"/>
                                                <select class="form-control is_new" style="width: 100%;" name="is_new" data-value="" >
                                                    <option value=""></option>
                                                    <option value="0" selected>否</option>
                                                    <option value="1" >是</option>
                                                </select>
                                            </div>
                                        </div>

                                        <div class="form-group  ">
                                            <label for="is_recommend" class="col-sm-2  control-label">是否推荐</label>
                                            <div class="col-sm-8">
                                                <label class="radio-inline">
                                                    <input type="radio" name="is_recommend" value="0" class="minimal is_recommend" checked  />&nbsp;否&nbsp;&nbsp;
                                                </label>
                                                <label class="radio-inline">
                                                    <input type="radio" name="is_recommend" value="1" class="minimal is_recommend"   />&nbsp;是&nbsp;&nbsp;
                                                </label>
                                            </div>
                                        </div>

                                        <div class="form-group  ">
                                            <label for="detail" class="col-sm-2  control-label">商品简介</label>
                                            <div class="col-sm-8">
                                                <textarea name="detail" class="form-control detail" rows="5" placeholder="输入 商品简介"  ></textarea>
                                            </div>
                                        </div>

                                        <div class="form-group  ">
                                            <label for="is_putaway" class="col-sm-2  control-label">发布？</label>
                                            <div class="col-sm-8">
                                                <input type="checkbox" class="is_putaway la_checkbox"   />
                                                <input type="hidden" class="is_putaway" name="is_putaway" class="" value="off" />
                                            </div>
                                        </div>

                                        <div class="form-group  ">
                                            <label for="goods_num" class="col-sm-2  control-label">商品排序</label>
                                            <div class="col-sm-8">
                                                <div class="input-group">
                                                    <input style="width: 100px" type="text" id="goods_num" name="goods_num" value="" class="form-control goods_num" placeholder="输入 商品排序" />
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group  ">
                                            <label for="goods_price" class="col-sm-2  control-label">商品总价</label>
                                            <div class="col-sm-8">
                                                <div class="input-group">
                                                    <span class="input-group-addon">￥</span>
                                                    <input style="width: 120px" type="text" id="goods_price" name="goods_price" value="" class="form-control goods_price" placeholder="输入 商品总价" />
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group  ">
                                            <label for="goods_tenancy_term" class="col-sm-2  control-label">租期</label>
                                            <div class="col-sm-8" id="goods_tenancy_term">
                                                <label class="checkbox-inline">
                                                    <input type="checkbox" name="goods_tenancy_term[]" value="1" class="goods_tenancy_term"  data-value="" />&nbsp;1&nbsp;&nbsp;
                                                </label>
                                                <label class="checkbox-inline">
                                                    <input type="checkbox" name="goods_tenancy_term[]" value="2" class="goods_tenancy_term"  data-value="" />&nbsp;2&nbsp;&nbsp;
                                                </label>
                                                <label class="checkbox-inline">
                                                    <input type="checkbox" name="goods_tenancy_term[]" value="3" class="goods_tenancy_term"  data-value="" />&nbsp;3&nbsp;&nbsp;
                                                </label>
                                                <input type="hidden" name="goods_tenancy_term[]">
                                            </div>
                                        </div>


                                        <div class="form-group  ">
                                            <label for="goods_img_list" class="col-sm-2  control-label">Goods img list</label>
                                            <div class="col-sm-8">
                                                <input type="file" class="goods_img_list" name="goods_img_list"  />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!-- /.box-body -->

                                <div class="box-footer">
                                    <input type="hidden" name="_token" value="Kq6b1qbgSwE02ACOgZOsO9QeD99PSWROQgk10d1w">
                                    <div class="col-md-2">
                                    </div>
                                    <div class="col-md-8">
                                        <div class="btn-group pull-right">
                                            <button type="submit" class="btn btn-primary">提交</button>
                                        </div>

                                        <label class="pull-right" style="margin: 5px 10px 0 0;">
                                            <input type="checkbox" class="after-submit" name="after-save" value="1"> 继续编辑
                                        </label>

                                        <label class="pull-right" style="margin: 5px 10px 0 0;">
                                            <input type="checkbox" class="after-submit" name="after-save" value="2"> 继续创建
                                        </label>

                                        <label class="pull-right" style="margin: 5px 10px 0 0;">
                                            <input type="checkbox" class="after-submit" name="after-save" value="3"> 查看
                                        </label>

                                        <div class="btn-group pull-left">
                                            <button type="reset" class="btn btn-warning">重置</button>
                                        </div>
                                    </div>
                                </div>
                                <!-- /.box-footer -->
                            </form>
                        </div>

                    </div></div>
            </section>
        </div>
        <script data-exec-on-popstate>
            $(function () {

                $(".is_new").select2({"allowClear":true,"placeholder":{"id":"","text":"是否新上1"}});

                $('.is_putaway.la_checkbox').bootstrapSwitch({
                    size:'small',
                    onText: 'ON',
                    offText: 'OFF',
                    onColor: 'primary',
                    offColor: 'default',
                    onSwitchChange: function(event, state) {
                        $(event.target).closest('.bootstrap-switch').next().val(state ? 'on' : 'off').change();
                    }
                });
                $("input.goods_img_list").fileinput({"overwriteInitial":true,"initialPreviewAsData":true,"browseLabel":"\u6d4f\u89c8","showRemove":false,"showUpload":false,"dropZoneEnabled":false,"deleteExtraData":{"goods_img_list":"_file_del_","_file_del_":"","_token":"Kq6b1qbgSwE02ACOgZOsO9QeD99PSWROQgk10d1w","_method":"PUT"},"deleteUrl":"http:\/\/www.laras.com\/admin\/goods\/","allowedFileTypes":["image"]});

                $('.after-submit').iCheck({checkboxClass:'icheckbox_minimal-blue'}).on('ifChecked', function () {
                    $('.after-submit').not(this).iCheck('uncheck');
                });
            });
        </script>
    </div>


    <!-- Main Footer -->
    <footer class="main-footer">
        <!-- To the right -->
        <div class="pull-right hidden-xs">
            <strong>Env</strong>&nbsp;&nbsp; local

            &nbsp;&nbsp;&nbsp;&nbsp;

            <strong>Version</strong>&nbsp;&nbsp; 1.6.10

        </div>
        <!-- Default to the left -->
        <strong>Powered by <a href="https://github.com/z-song/laravel-admin" target="_blank">laravel-admin</a></strong>
    </footer>
</div>

<script>
    function LA() {}
    LA.token = "{{ csrf_token() }}";
</script>

<!-- REQUIRED JS SCRIPTS -->
{!! Admin::js() !!}

</body>
</html>
